\hypertarget{rf__ntrx_8c}{
\section{/home/tech/release/K210-Devkit-CDROM-v1\_\-0\_\-3/subversion/nanostack/Platform/micro/rf\_\-ntrx.c File Reference}
\label{rf__ntrx_8c}\index{/home/tech/release/K210-Devkit-CDROM-v1_0_3/subversion/nanostack/Platform/micro/rf_ntrx.c@{/home/tech/release/K210-Devkit-CDROM-v1\_\-0\_\-3/subversion/nanostack/Platform/micro/rf\_\-ntrx.c}}
}
micro RF driver for the Nanotron NA5TR1 radio. 

{\tt \#include \char`\"{}Free\-RTOS.h\char`\"{}}\par
{\tt \#include \char`\"{}queue.h\char`\"{}}\par
{\tt \#include \char`\"{}task.h\char`\"{}}\par
{\tt \#include \char`\"{}semphr.h\char`\"{}}\par
{\tt \#include $<$sys/inttypes.h$>$}\par
{\tt \#include $<$signal.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}bus.h\char`\"{}}\par
{\tt \#include \char`\"{}debug.h\char`\"{}}\par
{\tt \#include \char`\"{}stack.h\char`\"{}}\par
{\tt \#include \char`\"{}mac.h\char`\"{}}\par
{\tt \#include \char`\"{}gpio.h\char`\"{}}\par
{\tt \#include \char`\"{}rf\_\-ntrx.h\char`\"{}}\par
{\tt \#include \char`\"{}progmem.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{rf__ntrx_8c_4ebfd1efb275630aa3aa67663e244f30}{rf\_\-isr} (void)
\item 
port\-CHAR \hyperlink{rf__ntrx_8c_fd6db435d4b4e09d32c69a9d4d8334a8}{rf\_\-rx\_\-enable} (void)
\item 
port\-CHAR \hyperlink{rf__ntrx_8c_d82d143983e9998c415860e3b5fe47a1}{rf\_\-rx\_\-disable} (void)
\item 
void \hyperlink{rf__ntrx_8c_3ed25f11154e35ac39b124374390cae2}{TRX\_\-COMMAND} (uint8\_\-t command)
\item 
uint8\_\-t \hyperlink{rf__ntrx_8c_7b5ccb2d0a3a8f43ded7af0f8f7cd3ee}{TRX\_\-COMMAND\_\-GET} (uint8\_\-t command)
\item 
int8\_\-t \hyperlink{rf__ntrx_8c_1fd0e4a2c586daecbb56743237240ebf}{TRX\_\-CHANNEL\_\-SET} (uint8\_\-t channel)
\item 
int8\_\-t \hyperlink{rf__ntrx_8c_52815349893ada8ef7d9f3eab35fc615}{TRX\_\-POWER\_\-SET} (uint8\_\-t new\_\-power)
\item 
void \hyperlink{rf__ntrx_8c_bdd5e51a1f400d445751875be5bd76c1}{TRX\_\-STAT} (uint8\_\-t status)
\item 
int8\_\-t \hyperlink{rf__ntrx_8c_5bc51829ffce40392d880756d1085298}{TRX\_\-REG\_\-GET} (uint8\_\-t reg, uint8\_\-t len, uint8\_\-t $\ast$buf)
\item 
int8\_\-t \hyperlink{rf__ntrx_8c_367044b1b54ed58ecc830785180a13f2}{TRX\_\-REG\_\-SET} (TRX\_\-W\_\-REG reg, TRX\_\-REG\_\-MASK mask, uint8\_\-t buf)
\item 
void \hyperlink{rf__ntrx_8c_62ce598350d5c6f6a226dc82485cfd76}{TRX\_\-SPI\_\-SETUP} (void)
\item 
int8\_\-t \hyperlink{rf__ntrx_8c_2cc27e4b97d170a9c645a152736ffd96}{rf\_\-check\_\-TRX\_\-version} (void)
\item 
void \hyperlink{rf__ntrx_8c_aa10b7cbd05cd50ca887d7a383c09635}{TRX\_\-Setup\_\-Mode} (uint8\_\-t fdma, uint8\_\-t symbolw, uint8\_\-t symbolr)
\item 
port\-CHAR \hyperlink{rf__ntrx_8c_62b2c9ce0b348d85542bbe1dc2a3b6c6}{rf\_\-address\_\-decoder\_\-mode} (uint8\_\-t mode)
\item 
void \hyperlink{rf__ntrx_8c_455cdf30e454351f6e2826fe95a168bf}{rx\_\-enable} (uint8\_\-t irq\_\-state)
\item 
void \hyperlink{rf__ntrx_8c_25f21d51effe6f8d8f0e1ce291559662}{rx\_\-disable} (void)
\item 
void \hyperlink{rf__ntrx_8c_fb21c78f2eef8ab609ce7a675c106e13}{tx\_\-enable} (void)
\item 
port\-CHAR \hyperlink{rf__ntrx_8c_d5647eee88c52cfdce3ca0050698d6a8}{rf\_\-mac\_\-get} (\hyperlink{structsockaddr__t}{sockaddr\_\-t} $\ast$address)
\item 
void \hyperlink{rf__ntrx_8c_91b1dad538e14708668fae49263edccb}{rf\_\-send\_\-ack} (uint8\_\-t pending)
\item 
int8\_\-t \hyperlink{rf__ntrx_8c_d9bcbebe4b4a24f33589758f40f6f01f}{rf\_\-channel\_\-set} (uint8\_\-t channel)
\item 
int8\_\-t \hyperlink{rf__ntrx_8c_9c0a6b3166fee2e94c93fffcc7311ed4}{rf\_\-power\_\-set} (uint8\_\-t new\_\-power)
\item 
port\-CHAR \hyperlink{rf__ntrx_8c_eec362bfdb2f849d39ad0d28e9222a72}{rf\_\-init} (void)
\item 
void \hyperlink{rf__ntrx_8c_262377dd5ce71a6ded4a7e4f86a2df1a}{rf\_\-set\_\-address} (\hyperlink{structsockaddr__t}{sockaddr\_\-t} $\ast$address)
\item 
int8\_\-t \hyperlink{rf__ntrx_8c_293d8239631f9bdb850229c63183db6c}{rf\_\-analyze\_\-rssi} (void)
\item 
port\-CHAR \hyperlink{rf__ntrx_8c_71b74455854c04aca3d86015cf95eb09}{rf\_\-cca\_\-check} (uint8\_\-t backoff\_\-count, uint8\_\-t slotted)
\item 
port\-CHAR \hyperlink{rf__ntrx_8c_dcdd963f53baa6a6c1e696347cee1ee7}{rf\_\-write} (\hyperlink{structbuffer__t}{buffer\_\-t} $\ast$buffer)
\item 
port\-CHAR \hyperlink{rf__ntrx_8c_a1f89bc90eab54291f913208b1ddef72}{rf\_\-write\_\-no\_\-cca} (\hyperlink{structbuffer__t}{buffer\_\-t} $\ast$buffer)
\item 
void \hyperlink{rf__ntrx_8c_88eea7787eb3b03f9caf112302d1d869}{rf\_\-rx\_\-callback} (void $\ast$param)
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
uint8\_\-t \hyperlink{rf__ntrx_8c_1d2e5e2303676dccf03415c32adef94b}{rx\_\-flags}
\item 
\hyperlink{structsockaddr__t}{sockaddr\_\-t} \hyperlink{rf__ntrx_8c_97f780cc1193d2084e497c370016601e}{mac\_\-long}
\end{CompactItemize}


\subsection{Detailed Description}
micro RF driver for the Nanotron NA5TR1 radio. 

Micro: RF control functions. 

\subsection{Function Documentation}
\hypertarget{rf__ntrx_8c_62b2c9ce0b348d85542bbe1dc2a3b6c6}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_address_decoder_mode@{rf\_\-address\_\-decoder\_\-mode}}
\index{rf_address_decoder_mode@{rf\_\-address\_\-decoder\_\-mode}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-address\_\-decoder\_\-mode]{\setlength{\rightskip}{0pt plus 5cm}port\-CHAR rf\_\-address\_\-decoder\_\-mode (uint8\_\-t {\em param})}}
\label{rf__ntrx_8c_62b2c9ce0b348d85542bbe1dc2a3b6c6}


Set address decoder on/off.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em param}]1=on 0=off. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]pd\-TRUE operation successful \end{Desc}
\hypertarget{rf__ntrx_8c_293d8239631f9bdb850229c63183db6c}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_analyze_rssi@{rf\_\-analyze\_\-rssi}}
\index{rf_analyze_rssi@{rf\_\-analyze\_\-rssi}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-analyze\_\-rssi]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t rf\_\-analyze\_\-rssi (void)}}
\label{rf__ntrx_8c_293d8239631f9bdb850229c63183db6c}


Channel energy detect.

Coordinator use this function detect best channel for PAN-network. \begin{Desc}
\item[Returns:]RSSI-energy level d\-Bm. 

0 operation failed. \end{Desc}
\hypertarget{rf__ntrx_8c_71b74455854c04aca3d86015cf95eb09}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_cca_check@{rf\_\-cca\_\-check}}
\index{rf_cca_check@{rf\_\-cca\_\-check}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-cca\_\-check]{\setlength{\rightskip}{0pt plus 5cm}port\-CHAR rf\_\-cca\_\-check (uint8\_\-t {\em backoff\_\-count}, uint8\_\-t {\em slotted})}}
\label{rf__ntrx_8c_71b74455854c04aca3d86015cf95eb09}


Clear channel assesment check.

\begin{Desc}
\item[Returns:]pd\-TRUE CCA clear 

pd\-FALSE CCA reserved \end{Desc}
\hypertarget{rf__ntrx_8c_d9bcbebe4b4a24f33589758f40f6f01f}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_channel_set@{rf\_\-channel\_\-set}}
\index{rf_channel_set@{rf\_\-channel\_\-set}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-channel\_\-set]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t rf\_\-channel\_\-set (uint8\_\-t {\em channel})}}
\label{rf__ntrx_8c_d9bcbebe4b4a24f33589758f40f6f01f}


Select RF channel.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em channel}]channel number to select\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]channel value or negative (invalid channel number) \end{Desc}
\hypertarget{rf__ntrx_8c_2cc27e4b97d170a9c645a152736ffd96}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_check_TRX_version@{rf\_\-check\_\-TRX\_\-version}}
\index{rf_check_TRX_version@{rf\_\-check\_\-TRX\_\-version}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-check\_\-TRX\_\-version]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t rf\_\-check\_\-TRX\_\-version (void)}}
\label{rf__ntrx_8c_2cc27e4b97d170a9c645a152736ffd96}


Check NA5TR1 version and revision.

\begin{Desc}
\item[Returns:]pd\-TRUE if version and revision ok, pd\-FALSE if either/both wrong \end{Desc}
\hypertarget{rf__ntrx_8c_eec362bfdb2f849d39ad0d28e9222a72}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_init@{rf\_\-init}}
\index{rf_init@{rf\_\-init}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-init]{\setlength{\rightskip}{0pt plus 5cm}port\-CHAR rf\_\-init (void)}}
\label{rf__ntrx_8c_eec362bfdb2f849d39ad0d28e9222a72}


Initialize RF.

\begin{Desc}
\item[Returns:]pd\-TRUE 

pd\-FALSE bus not free or init failed \end{Desc}
\hypertarget{rf__ntrx_8c_4ebfd1efb275630aa3aa67663e244f30}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_isr@{rf\_\-isr}}
\index{rf_isr@{rf\_\-isr}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-isr]{\setlength{\rightskip}{0pt plus 5cm}void rf\_\-isr (void)}}
\label{rf__ntrx_8c_4ebfd1efb275630aa3aa67663e244f30}


Receiver lock. \hypertarget{rf__ntrx_8c_d5647eee88c52cfdce3ca0050698d6a8}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_mac_get@{rf\_\-mac\_\-get}}
\index{rf_mac_get@{rf\_\-mac\_\-get}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-mac\_\-get]{\setlength{\rightskip}{0pt plus 5cm}port\-CHAR rf\_\-mac\_\-get (\hyperlink{structsockaddr__t}{sockaddr\_\-t} $\ast$ {\em address})}}
\label{rf__ntrx_8c_d5647eee88c52cfdce3ca0050698d6a8}


Get HW MAC address

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em address}]address to set \end{description}
\end{Desc}
\hypertarget{rf__ntrx_8c_9c0a6b3166fee2e94c93fffcc7311ed4}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_power_set@{rf\_\-power\_\-set}}
\index{rf_power_set@{rf\_\-power\_\-set}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-power\_\-set]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t rf\_\-power\_\-set (uint8\_\-t {\em new\_\-power})}}
\label{rf__ntrx_8c_9c0a6b3166fee2e94c93fffcc7311ed4}


Select RF transmit power.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em new\_\-power}]new power level (in per cent)\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]new level or negative (value out of range) \end{Desc}
\hypertarget{rf__ntrx_8c_88eea7787eb3b03f9caf112302d1d869}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_rx_callback@{rf\_\-rx\_\-callback}}
\index{rf_rx_callback@{rf\_\-rx\_\-callback}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-rx\_\-callback]{\setlength{\rightskip}{0pt plus 5cm}void rf\_\-rx\_\-callback (void $\ast$ {\em param})}}
\label{rf__ntrx_8c_88eea7787eb3b03f9caf112302d1d869}


RF receive callback \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em param}]not used \end{description}
\end{Desc}
\hypertarget{rf__ntrx_8c_d82d143983e9998c415860e3b5fe47a1}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_rx_disable@{rf\_\-rx\_\-disable}}
\index{rf_rx_disable@{rf\_\-rx\_\-disable}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-rx\_\-disable]{\setlength{\rightskip}{0pt plus 5cm}port\-CHAR rf\_\-rx\_\-disable (void)}}
\label{rf__ntrx_8c_d82d143983e9998c415860e3b5fe47a1}


Disable RF receiver.

\begin{Desc}
\item[Returns:]pd\-TRUE 

pd\-FALSE bus not free \end{Desc}
\hypertarget{rf__ntrx_8c_fd6db435d4b4e09d32c69a9d4d8334a8}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_rx_enable@{rf\_\-rx\_\-enable}}
\index{rf_rx_enable@{rf\_\-rx\_\-enable}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-rx\_\-enable]{\setlength{\rightskip}{0pt plus 5cm}port\-CHAR rf\_\-rx\_\-enable (void)}}
\label{rf__ntrx_8c_fd6db435d4b4e09d32c69a9d4d8334a8}


Enable RF receiver.

\begin{Desc}
\item[Returns:]pd\-TRUE 

pd\-FALSE bus not free \end{Desc}
\hypertarget{rf__ntrx_8c_91b1dad538e14708668fae49263edccb}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_send_ack@{rf\_\-send\_\-ack}}
\index{rf_send_ack@{rf\_\-send\_\-ack}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-send\_\-ack]{\setlength{\rightskip}{0pt plus 5cm}void rf\_\-send\_\-ack (uint8\_\-t {\em pending})}}
\label{rf__ntrx_8c_91b1dad538e14708668fae49263edccb}


Send ACK.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pending}]set up pending flag if pending $>$ 0. \end{description}
\end{Desc}
\hypertarget{rf__ntrx_8c_262377dd5ce71a6ded4a7e4f86a2df1a}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_set_address@{rf\_\-set\_\-address}}
\index{rf_set_address@{rf\_\-set\_\-address}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-set\_\-address]{\setlength{\rightskip}{0pt plus 5cm}void rf\_\-set\_\-address (\hyperlink{structsockaddr__t}{sockaddr\_\-t} $\ast$ {\em address})}}
\label{rf__ntrx_8c_262377dd5ce71a6ded4a7e4f86a2df1a}


Set address decoder parameters

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em address}]address for decoder \end{description}
\end{Desc}
\hypertarget{rf__ntrx_8c_dcdd963f53baa6a6c1e696347cee1ee7}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_write@{rf\_\-write}}
\index{rf_write@{rf\_\-write}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-write]{\setlength{\rightskip}{0pt plus 5cm}port\-CHAR rf\_\-write (\hyperlink{structbuffer__t}{buffer\_\-t} $\ast$ {\em buffer})}}
\label{rf__ntrx_8c_dcdd963f53baa6a6c1e696347cee1ee7}


Transmit packet.

Missing feature: address type check

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mac}]RF HW address \item[{\em dst}]destination HW address \item[{\em buffer}]data buffer pointer \item[{\em length}]length of data\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]pd\-TRUE+1 channel occupied 

pd\-TRUE 

pd\-FALSE bus reserved \end{Desc}
\hypertarget{rf__ntrx_8c_a1f89bc90eab54291f913208b1ddef72}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rf_write_no_cca@{rf\_\-write\_\-no\_\-cca}}
\index{rf_write_no_cca@{rf\_\-write\_\-no\_\-cca}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rf\_\-write\_\-no\_\-cca]{\setlength{\rightskip}{0pt plus 5cm}port\-CHAR rf\_\-write\_\-no\_\-cca (\hyperlink{structbuffer__t}{buffer\_\-t} $\ast$ {\em buffer})}}
\label{rf__ntrx_8c_a1f89bc90eab54291f913208b1ddef72}


Transmit packet without channel check.

Missing feature: address type check

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mac}]RF HW address \item[{\em dst}]destination HW address \item[{\em buffer}]data buffer pointer \item[{\em length}]length of data\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]pd\-TRUE 

pd\-FALSE bus reserved \end{Desc}
\hypertarget{rf__ntrx_8c_25f21d51effe6f8d8f0e1ce291559662}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rx_disable@{rx\_\-disable}}
\index{rx_disable@{rx\_\-disable}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rx\_\-disable]{\setlength{\rightskip}{0pt plus 5cm}void rx\_\-disable (void)}}
\label{rf__ntrx_8c_25f21d51effe6f8d8f0e1ce291559662}


Turn off RF receive mode. \hypertarget{rf__ntrx_8c_455cdf30e454351f6e2826fe95a168bf}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rx_enable@{rx\_\-enable}}
\index{rx_enable@{rx\_\-enable}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rx\_\-enable]{\setlength{\rightskip}{0pt plus 5cm}void rx\_\-enable (uint8\_\-t {\em irq\_\-state})}}
\label{rf__ntrx_8c_455cdf30e454351f6e2826fe95a168bf}


Set RF to receive mode. \hypertarget{rf__ntrx_8c_1fd0e4a2c586daecbb56743237240ebf}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!TRX_CHANNEL_SET@{TRX\_\-CHANNEL\_\-SET}}
\index{TRX_CHANNEL_SET@{TRX\_\-CHANNEL\_\-SET}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[TRX\_\-CHANNEL\_\-SET]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t TRX\_\-CHANNEL\_\-SET (uint8\_\-t {\em channel})}}
\label{rf__ntrx_8c_1fd0e4a2c586daecbb56743237240ebf}


Select RF channel.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em channel}]channel number to select\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]channel value or negative (invalid channel number) \end{Desc}
\hypertarget{rf__ntrx_8c_3ed25f11154e35ac39b124374390cae2}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!TRX_COMMAND@{TRX\_\-COMMAND}}
\index{TRX_COMMAND@{TRX\_\-COMMAND}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[TRX\_\-COMMAND]{\setlength{\rightskip}{0pt plus 5cm}void TRX\_\-COMMAND (uint8\_\-t {\em command})}}
\label{rf__ntrx_8c_3ed25f11154e35ac39b124374390cae2}


RF single byte command.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em command}]RF command to send \end{description}
\end{Desc}
\hypertarget{rf__ntrx_8c_7b5ccb2d0a3a8f43ded7af0f8f7cd3ee}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!TRX_COMMAND_GET@{TRX\_\-COMMAND\_\-GET}}
\index{TRX_COMMAND_GET@{TRX\_\-COMMAND\_\-GET}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[TRX\_\-COMMAND\_\-GET]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t TRX\_\-COMMAND\_\-GET (uint8\_\-t {\em command})}}
\label{rf__ntrx_8c_7b5ccb2d0a3a8f43ded7af0f8f7cd3ee}


RF single byte command with return value.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em command}]RF command to send\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]status byte from SPI \end{Desc}
\hypertarget{rf__ntrx_8c_52815349893ada8ef7d9f3eab35fc615}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!TRX_POWER_SET@{TRX\_\-POWER\_\-SET}}
\index{TRX_POWER_SET@{TRX\_\-POWER\_\-SET}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[TRX\_\-POWER\_\-SET]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t TRX\_\-POWER\_\-SET (uint8\_\-t {\em new\_\-power})}}
\label{rf__ntrx_8c_52815349893ada8ef7d9f3eab35fc615}


Select RF transmit power.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em new\_\-power}]new power level (in per cent)\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]new level or negative (value out of range) \end{Desc}
\hypertarget{rf__ntrx_8c_5bc51829ffce40392d880756d1085298}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!TRX_REG_GET@{TRX\_\-REG\_\-GET}}
\index{TRX_REG_GET@{TRX\_\-REG\_\-GET}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[TRX\_\-REG\_\-GET]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t TRX\_\-REG\_\-GET (uint8\_\-t {\em reg}, uint8\_\-t {\em len}, uint8\_\-t $\ast$ {\em buf})}}
\label{rf__ntrx_8c_5bc51829ffce40392d880756d1085298}


RF register read. \hypertarget{rf__ntrx_8c_367044b1b54ed58ecc830785180a13f2}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!TRX_REG_SET@{TRX\_\-REG\_\-SET}}
\index{TRX_REG_SET@{TRX\_\-REG\_\-SET}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[TRX\_\-REG\_\-SET]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t TRX\_\-REG\_\-SET (TRX\_\-W\_\-REG {\em reg}, TRX\_\-REG\_\-MASK {\em mask}, uint8\_\-t {\em buf})}}
\label{rf__ntrx_8c_367044b1b54ed58ecc830785180a13f2}


RF register write. \hypertarget{rf__ntrx_8c_aa10b7cbd05cd50ca887d7a383c09635}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!TRX_Setup_Mode@{TRX\_\-Setup\_\-Mode}}
\index{TRX_Setup_Mode@{TRX\_\-Setup\_\-Mode}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[TRX\_\-Setup\_\-Mode]{\setlength{\rightskip}{0pt plus 5cm}void TRX\_\-Setup\_\-Mode (uint8\_\-t {\em fdma}, uint8\_\-t {\em symbolw}, uint8\_\-t {\em symbolr})}}
\label{rf__ntrx_8c_aa10b7cbd05cd50ca887d7a383c09635}


Set a specific transmission mode.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fdma}]Channel bandwidth \item[{\em symbolw}]Symbol width (duration) \item[{\em symbolr}]Symbol rate \end{description}
\end{Desc}
\hypertarget{rf__ntrx_8c_62ce598350d5c6f6a226dc82485cfd76}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!TRX_SPI_SETUP@{TRX\_\-SPI\_\-SETUP}}
\index{TRX_SPI_SETUP@{TRX\_\-SPI\_\-SETUP}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[TRX\_\-SPI\_\-SETUP]{\setlength{\rightskip}{0pt plus 5cm}void TRX\_\-SPI\_\-SETUP (void)}}
\label{rf__ntrx_8c_62ce598350d5c6f6a226dc82485cfd76}


RF SPI reset. \hypertarget{rf__ntrx_8c_bdd5e51a1f400d445751875be5bd76c1}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!TRX_STAT@{TRX\_\-STAT}}
\index{TRX_STAT@{TRX\_\-STAT}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[TRX\_\-STAT]{\setlength{\rightskip}{0pt plus 5cm}void TRX\_\-STAT (uint8\_\-t {\em status})}}
\label{rf__ntrx_8c_bdd5e51a1f400d445751875be5bd76c1}


Print RF status byte in human readable form.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em status}]status byte value \end{description}
\end{Desc}
\hypertarget{rf__ntrx_8c_fb21c78f2eef8ab609ce7a675c106e13}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!tx_enable@{tx\_\-enable}}
\index{tx_enable@{tx\_\-enable}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[tx\_\-enable]{\setlength{\rightskip}{0pt plus 5cm}void tx\_\-enable (void)}}
\label{rf__ntrx_8c_fb21c78f2eef8ab609ce7a675c106e13}


Initialize RF for tx mode. 

\subsection{Variable Documentation}
\hypertarget{rf__ntrx_8c_97f780cc1193d2084e497c370016601e}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!mac_long@{mac\_\-long}}
\index{mac_long@{mac\_\-long}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[mac\_\-long]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{structsockaddr__t}{sockaddr\_\-t} \hyperlink{rf__ntrx_8c_97f780cc1193d2084e497c370016601e}{mac\_\-long}}}
\label{rf__ntrx_8c_97f780cc1193d2084e497c370016601e}


MAC address. \hypertarget{rf__ntrx_8c_1d2e5e2303676dccf03415c32adef94b}{
\index{rf_ntrx.c@{rf\_\-ntrx.c}!rx_flags@{rx\_\-flags}}
\index{rx_flags@{rx\_\-flags}!rf_ntrx.c@{rf\_\-ntrx.c}}
\subsubsection[rx\_\-flags]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t \hyperlink{rf__ntrx_8c_1d2e5e2303676dccf03415c32adef94b}{rx\_\-flags}}}
\label{rf__ntrx_8c_1d2e5e2303676dccf03415c32adef94b}


State flags. 